home *** CD-ROM | disk | FTP | other *** search
/ PC for Alla 2005 May / PC för Alla 0505.iso / fullversioner / realsoft3d / data1.cab / Scripting / scripting / Intro / sliders.js < prev    next >
Encoding:
Text File  |  2005-04-04  |  1.1 KB  |  39 lines

  1. include("oops/r3slider.js"); 
  2. include("oops/r3window.js"); 
  3. include("oops/r3packer.js"); 
  4.  
  5. // --- Create a window --
  6.  
  7. window = new r3Window(R3WGA_Parent, _r3gui,
  8.                       R3WA_ReportCloseWindow, TRUE,
  9.                       R3WA_ReportNewSize, TRUE,
  10.                       R3WA_Title, "Align Sliders");
  11.  
  12. // second, thought, let's move the window to position 200, 100
  13. window.SetLeft(200);
  14. window.SetTop(100);
  15.  
  16. // -- create a geometry manager (packer) as usual
  17.  
  18. packer = new r3Packer(R3PA_Orientation, R3PAOF_VERTICAL); 
  19. window.SetGmanager(packer); 
  20.  
  21.  
  22. // --- create five sliders 
  23.  
  24. var sliderLabels = ["Strength", "Brightness", "Number of colors", 
  25. "Age", "Weight"];
  26.  
  27. for(i = 0; i < sliderLabels.length; i++) {
  28.     slider =  new r3Slider(R3WGA_Parent, window,
  29.                            R3GA_Text, sliderLabels[i],
  30.                            R3GA_ToolTip, "This is a tool tip",
  31.                            R3GSLA_Min, 0,
  32.                            R3GSLA_Max, 100);
  33.     packer.ADD(R3PAPF_EXPAND | R3PAPF_FILLX, R3PAAF_ALIGN, slider);
  34. }
  35.  
  36.  
  37. window.FIT(R3WFP_BESTFIT); 
  38. window.REALIZE();
  39.